﻿<%@ WebHandler Language="C#" Class="Del" %>

using System;
using System.Web;
using Dos.Model;

public class Del : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        if (context.Request["id"] != null && context.Request["id"] != string.Empty)
        {
            HttpRequest rq = context.Request;
            temple_Contents ra = DB.Context.From<temple_Contents>().Select(s => new { s.ID, s.IsDel }).Where(w => w.ID == int.Parse(rq["id"])).First();
            ra.IsDel = true;
            int tmp = DB.Context.Update(ra);
            context.Response.Write(tmp);
        }
        else
            context.Response.Write(0);
    }

    public bool IsReusable
    {
        get { return false; }
    }

}